package com.dice.dagger2study.model.Imp;

import com.dice.dagger2study.bean.ResponseBean;
import com.dice.dagger2study.model.i.ILoginModel;
import com.dice.dagger2study.util.OkHttpClientManager;
import com.squareup.okhttp.Request;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;

/**
 * Created by weiyi on 2017/11/14.
 */

public class LoginModelImp implements ILoginModel{

    @Override
    public void login(String username, String pwd,final LoginListener listener) {
        Map<String,String> params = new HashMap<String,String>();

        OkHttpClientManager.postAsyn("", new OkHttpClientManager.ResultCallback<ResponseBean>() {
            @Override
            public void onError(Request request, Exception e) {
                listener.falied(0,"登录失败");
            }

            @Override
            public void onResponse(ResponseBean s) {
                listener.success();
            }
        }, params);
    }
}
